<template>
	<view>
		<view class="top">
			<image src="../../static/myImage/user.png" mode="" :style="'border-color:' + (isLogin ? '#DA251D' : '#D5D6DC')"></image>
			<view class="name_box">
				<text>Hi~</text>
				<text v-if="userInfo.name">{{ userInfo.name }}</text>
				<text v-else @click="toLogin">
					欢迎
					<text class="login_text">登录</text>
				</text>
			</view>
		</view>
		<view class="data_box">
			<navigator url="../creditDetails/creditDetails" hover-class="none">
				<view class="data_item">
					<text class="number">165</text>
					<text>我的积分</text>
				</view>
			</navigator>
			<u-line color="#ffffff" direction="col" length="80"></u-line>
			<navigator url="../myOrder/myOrder" hover-class="none">
				<view class="data_item">
					<text class="number">12</text>
					<text>我的订单</text>
				</view>
			</navigator>
			<u-line color="#ffffff" direction="col" length="80"></u-line>
			<navigator url="../myTeam/myTeam">
				<view class="data_item">
					<text class="number">20</text>
					<text>我的团队</text>
				</view>
			</navigator>
		</view>
		<view class="type_box">
			<navigator url="../signIn/signIn" hover-class="none">
				<view class="type_item">
					<view class="type_left">
						<image src="../../static/myImage/icon1.png" mode=""></image>
						<text>每日签到</text>
					</view>
					<u-icon name="arrow-right" color="#999999" size="11"></u-icon>
				</view>
			</navigator>
			<navigator url="../turntable/turntable" hover-class="none">
				<view class="type_item">
					<view class="type_left">
						<image src="../../static/myImage/icon2.png" mode=""></image>
						<text>幸运转盘</text>
					</view>
					<u-icon name="arrow-right" color="#999999" size="11"></u-icon>
				</view>
			</navigator>
			<navigator url="../creditDetails/creditDetails" hover-class="none">
				<view class="type_item">
					<view class="type_left">
						<image src="../../static/myImage/icon3.png" mode=""></image>
						<text>积分明细</text>
					</view>
					<u-icon name="arrow-right" color="#999999" size="11"></u-icon>
				</view>
			</navigator>
			<navigator url="../aboutUs/aboutUs" hover-class="none">
				<view class="type_item">
					<view class="type_left">
						<image src="../../static/myImage/icon4.png" mode=""></image>
						<text>关于我们</text>
					</view>
					<u-icon name="arrow-right" color="#999999" size="11"></u-icon>
				</view>
			</navigator>
			<navigator url="../invitation/invitation" hover-class="none">
				<view class="type_item">
					<view class="type_left">
						<image src="../../static/myImage/icon5.png" mode=""></image>
						<text>邀请加入</text>
					</view>
					<u-icon name="arrow-right" color="#999999" size="11"></u-icon>
				</view>
			</navigator>
			<navigator url="../setting/setting" hover-class="none">
				<view class="type_item">
					<view class="type_left">
						<image src="../../static/myImage/icon6.png" mode=""></image>
						<text>设置</text>
					</view>
					<u-icon name="arrow-right" color="#999999" size="11"></u-icon>
				</view>
			</navigator>
		</view>
		<u-mask :show="popShow" @click="popShow = false" z-index="9999">
			<view class="warp">
				<view class="rect" @tap.stop>
					<view class="pop_box">
						<image src="../../static/myImage/popbg.png" mode=""></image>
						<view class="sign_box">
							<view>连续签到领积分</view>
							<text @click="toSignIn">立即签到</text>
						</view>
					</view>
					<image src="../../static/myImage/close_icon.png" mode="" class="close" @click="popShow = false"></image>
				</view>
			</view>
		</u-mask>
	</view>
</template>

<script>
export default {
	data() {
		return {
			isLogin: false,
			userInfo: {},
			popShow: true,
			showOnce: false
		};
	},
	methods: {
		toSignIn() {
			uni.navigateTo({
				url: '../signIn/signIn'
			});
		},
		toLogin() {
			uni.navigateTo({
				url: '../login/login'
			});
		}
	},
	onLoad() {
		setTimeout(() => {
			this.popShow = true;
			this.showOnce = true;
		}, 1000);
	},
	onShow() {}
};
</script>

<style lang="scss" scoped>
.top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 60upx;
	image {
		width: 136upx;
		height: 136upx;
		border-radius: 50%;
		padding: 7upx;
		border: 2upx dashed;
	}
	.name_box {
		display: flex;
		flex-direction: column;
		text-align: right;
		text {
			font-size: 34upx;
		}
		.login_text {
			color: $red;
		}
	}
}
.data_box {
	height: 160upx;
	background: url(../../static/myImage/black.png) no-repeat;
	background-size: 100% 100%;
	display: flex;
	justify-content: space-around;
	align-items: center;
	margin-bottom: 30upx;
	.data_item {
		color: #ffffff;
		display: flex;
		flex-direction: column;
		text-align: center;
		align-items: center;
		.number {
			margin-bottom: 20upx;
			font-weight: bold;
		}
		.number + text {
			font-size: 28upx;
		}
	}
}
.type_box {
	padding: 0 30upx;
	background: #ffffff;
	border-radius: 15upx;
	.type_item {
		display: flex;
		align-items: center;
		padding: 30upx 0;
		justify-content: space-between;
		font-size: 30upx;
		border-bottom: 2upx solid #e4e4e4;
		&:last-child {
			border: none;
		}
		.type_left {
			display: flex;
			align-items: center;
			image {
				width: 40upx;
				height: 40upx;
				margin-right: 18upx;
			}
		}
	}
}

.warp {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}
.rect {
	width: 400upx;
	// background-color: #fff;
	.pop_box {
		position: relative;
		image {
			width: 100%;
			height: 460upx;
			position: relative;
			top: 0;
			left: 0;
			z-index: 99;
		}
		margin-bottom: 95upx;
		.sign_box {
			position: absolute;
			bottom: 40upx;
			left: 50%;
			z-index: 999;
			transform: translate(-50%);
			text-align: center;
			view {
				color: $red;
				font-size: 32upx;
				white-space: nowrap;
				padding-bottom: 38upx;
			}
			text {
				color: #fff;
				font-size: 28upx;
				padding: 11upx 36upx;
				border-radius: 100upx;
				background: linear-gradient(90deg, $red 0%, #ffbab7 100%);
			}
		}
	}
	.close {
		width: 50upx;
		height: 50upx;
		display: block;
		margin: 0 auto;
	}
}
</style>

<style>
page {
	background: linear-gradient(45deg, #f7f7f7 0%, #ffeef0 100%);
	padding: 90upx 30upx;
}
</style>
